﻿/// <reference path="jquery-1.4.4-vsdoc.js" />

$.fn.center = function (config) {
    if (config == undefined || config.left == true)
        $(this).css({ left: (($(window).width() / 2) - ($(this).width() / 2)) });

    if (config == undefined || config.top == true)
        $(this).css({ top: ($(window).scrollTop() + ($(window).height() / 2 - ($(this).height() / 2))) });

    return this;
}